<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
        <?php
        // put your code here
        $UserID=$_POST['ID'];
        $PassWord=$_POST['PassWord'];
        $conn1 = mysqli_connect('localhost', 'root', 'root', 'isc');
        if (!$conn1) {
            die('Could not connect to MySQL: ' . mysqli_connect_error());
        }
        $result0 =  mysqli_query($conn1, "SELECT password FROM rfid where roll_id='$UserID'and password='$PassWord'");
        if (!$result0)
        echo 查无此用户ID或密码错误;
        else
        $result = mysqli_query($conn1, "SELECT name FROM roll where id='$UserID'");
        $UserName_array = mysqli_fetch_row($result);
        echo "Welcome".$UserName_array[0];

        $lifeTime = 100;
        session_set_cookie_params($lifeTime); 
        session_start();
        $_SESSION['UserName'] = $UserName_array[0];

        mysqli_free_result($result);

        mysqli_close($conn1);
        ?>

